/**
 * 主SCSS文件
 * 集中导入所有样式文件
 */

/* 基础变量 */
:root {
  --primary-color: #4c6ef5;
  --primary-light: #e7eaff;
  --secondary-color: #5e60ce;
  --success-color: #40c057;
  --warning-color: #fcc419;
  --danger-color: #fa5252;
  --info-color: #15aabf;
  --dark-color: #343a40;
  --light-color: #f8f9fa;
  --body-bg: #f5f7fb;
  --sidebar-bg: #ffffff;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 70px;
  --header-height: 70px;
  --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --border-radius: 0.375rem;
  --transition-speed: 0.3s;
}

/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito Sans', sans-serif;
  background-color: var(--body-bg);
  color: var(--dark-color);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* 仪表盘布局 */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  background-color: var(--sidebar-bg);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: width var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  cursor: pointer;
}

.logo span[data-icon] {
  margin-right: 0.75rem;
  font-size: 1.5rem;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.sidebar-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--primary-color);
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 0;
  overflow-y: auto;
}

.sidebar-nav ul li {
  margin-bottom: 0.25rem;
}

.sidebar-nav ul li a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: #6c757d;
  transition: all 0.2s ease;
}

.sidebar-nav ul li a:hover {
  background-color: #f8f9fa;
  color: var(--primary-color);
}

.sidebar-nav ul li.active a {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 600;
  border-right: 3px solid var(--primary-color);
}

.sidebar-nav ul li a span[data-icon] {
  margin-right: 0.75rem;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.logout-btn {
  display: flex;
  align-items: center;
  color: #6c757d;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background-color: #f8f9fa;
  color: var(--danger-color);
}

.logout-btn span[data-icon] {
  margin-right: 0.75rem;
}

/* 侧边栏折叠状态 */
.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .logo span:not([data-icon]),
.sidebar-collapsed .sidebar-nav ul li a span:not([data-icon]),
.sidebar-collapsed .sidebar-footer .logout-btn span:not([data-icon]) {
  display: none;
}

.sidebar-collapsed .sidebar-nav ul li a {
  justify-content: center;
  padding: 0.75rem;
}

.sidebar-collapsed .sidebar-nav ul li a span[data-icon] {
  margin-right: 0;
}

.sidebar-collapsed .logo {
  justify-content: center;
}

.sidebar-collapsed .sidebar-toggle {
  display: none;
}

.sidebar-collapsed .logout-btn {
  justify-content: center;
}

.sidebar-collapsed .logout-btn span[data-icon] {
  margin-right: 0;
}

/* 顶部导航栏样式 */
.header {
  height: var(--header-height);
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}

.header-left {
  display: flex;
  align-items: center;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #343a40;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
}

.search-box {
  position: relative;
  margin-right: 1.5rem;
  width: 300px;
}

.search-box input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid #e9ecef;
  border-radius: 50px;
  background-color: #f8f9fa;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(76, 110, 245, 0.15);
}

.search-box button {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #adb5bd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notifications {
  margin-right: 1.5rem;
  position: relative;
}

.notifications button {
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.notifications button:hover {
  background-color: #f8f9fa;
  color: var(--primary-color);
}

.badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--danger-color);
  color: #fff;
  font-size: 0.75rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-menu {
  position: relative;
}

.user-menu button {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.user-menu button:hover {
  background-color: #f8f9fa;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 0.75rem;
}

.user-name {
  font-weight: 600;
  margin-right: 0.5rem;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #fff;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  width: 200px;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  display: none;
  z-index: 1000;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #343a40;
  transition: all 0.2s ease;
}

.dropdown-menu a:hover {
  background-color: #f8f9fa;
  color: var(--primary-color);
}

.dropdown-menu a span[data-icon] {
  margin-right: 0.75rem;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-menu hr {
  margin: 0.5rem 0;
  border: none;
  border-top: 1px solid #e9ecef;
}

.dropdown-menu .logout {
  color: var(--danger-color);
}

.dropdown-menu .logout:hover {
  background-color: #f8f9fa;
  color: var(--danger-color);
}

/* 主内容区样式 */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-speed) ease;
  padding-top: var(--header-height);
}

.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

/* 内容区域 */
.content {
  padding: 2rem;
}

/* 统计卡片 */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
}

.stat-icon.patients {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.stat-icon.appointments {
  background-color: #fff3bf;
  color: #fab005;
}

.stat-icon.diagnosis {
  background-color: #ebfbee;
  color: var(--success-color);
}

.stat-icon.records {
  background-color: #e3fafc;
  color: var(--info-color);
}

.stat-data h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stat-change {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
}

.stat-change span {
  color: #6c757d;
  margin-left: 0.25rem;
}

.stat-change.increase {
  color: var(--success-color);
}

.stat-change.decrease {
  color: var(--danger-color);
}

/* 图表和表格区域 */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.dashboard-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.dashboard-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--light-color);
  background-color: #fafbfc;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: #495057;
}

.card-header .card-actions select {
  padding: 0.375rem 1.75rem 0.375rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  background-color: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}

.card-body {
  padding: 1.5rem;
}

.chart-container {
  height: 300px;
  position: relative;
}

/* 预约列表样式 */
.appointment-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.appointment-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-radius: 0.25rem;
  background-color: #f8f9fa;
  transition: background-color 0.2s ease;
}

.appointment-item:hover {
  background-color: #e9ecef;
}

.appointment-time {
  font-weight: 600;
  color: #495057;
  min-width: 60px;
}

.appointment-info {
  flex: 1;
  margin: 0 1rem;
}

.appointment-info h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.appointment-info p {
  font-size: 0.875rem;
  color: #6c757d;
  margin: 0;
}

.appointment-status {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.appointment-status.confirmed {
  background-color: #d4edda;
  color: #155724;
}

.appointment-status.pending {
  background-color: #fff3cd;
  color: #856404;
}

/* 诊断列表样式 */
.diagnosis-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.diagnosis-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-radius: 0.25rem;
  background-color: #f8f9fa;
  transition: background-color 0.2s ease;
}

.diagnosis-item:hover {
  background-color: #e9ecef;
}

.diagnosis-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #dee2e6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #495057;
}

.diagnosis-info {
  flex: 1;
  margin: 0 1rem;
}

.diagnosis-info h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.diagnosis-info p {
  font-size: 0.75rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.diagnosis-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.diagnosis-tags .tag {
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  background-color: #e7f5ff;
  color: #1971c2;
}

.diagnosis-accuracy {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  background-color: #e7f5ff;
  color: #1971c2;
  font-weight: 600;
  font-size: 0.875rem;
}

/* 响应式适配 */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .stats-cards {
    grid-template-columns: 1fr;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .header {
    padding: 0 1rem;
  }
  
  .search-box {
    width: 200px;
  }
}

@media (max-width: 576px) {
  .header {
    height: auto;
    flex-direction: column;
    padding: 1rem;
  }
  
  .header-left, .header-right {
    width: 100%;
    justify-content: space-between;
  }
  
  .header-left {
    margin-bottom: 1rem;
  }
  
  .search-box {
    width: 100%;
    margin-right: 0;
    margin-bottom: 1rem;
  }
  
  .content {
    padding: 1rem;
  }
} 